package ihm.tabs;

import ihm.overlays.AlbumOverlay;
import ihm.overlays.AlbumsOverlay;
import ihm.overlays.PictureOverlay;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.widgets.Composite;


public class PicturesTab extends Composite
{
	
	private StackLayout layout;
	
	private AlbumsOverlay albums;
	private AlbumOverlay album;
	private PictureOverlay picture;

	public PicturesTab( Composite father ) {
		super(father, SWT.NONE);
		layout = new StackLayout();
		setLayout( layout );

		albums = new AlbumsOverlay( this );
		album = new AlbumOverlay( this );
		picture = new PictureOverlay( this );

		setLayoutToAlbums();
	}

	public void setLayoutToAlbums() {
		this.albums.update();
		layout.topControl = this.albums;
		layout();
	}

	public void setLayoutToAlbum( String albumID, String albumName ) {
		this.album.update( albumID, albumName );
		layout.topControl = this.album;
		layout();
	}

	public void setLayoutToPicture( String pictureID, String albumID, String albumName ) {
		this.picture.update( pictureID, albumID, albumName );
		layout.topControl = this.picture;
		layout();
	}
}
